// write your code here
import java.util.Scanner;
import java.util.ArrayList;

public class Main{
    
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        while(sc.hasNext()){
            int n = sc.nextInt();
            sc.nextLine();    //为什么需要这一句 苍天啊  我头大了  5.27
            ArrayList<String> list = new ArrayList<>(); //创建一个
            for(int i = 0; i < n; i++){
                String str = sc.nextLine();
                if(str.contains(" ") || str.contains(",")){
                    list.add("\""+str+"\"");  //这一句值得研究
                }else{
                    list.add(str);
                }
            }
            for(int i = 0; i < n-1; i++){
                System.out.print(list.get(i)+", ");
            }
            System.out.println(list.get(n-1));
        }
        sc.close();
    }
}